package Demo01;

public class Thread01 extends Thread{
    public void run(){
        for (int i = 0; i < 20; i++) {
            try {
                sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("我在看代码");
        }
    }

    public static void main(String[] args) throws InterruptedException {
        // Thread01 线程
        Thread01 test1 = new Thread01();
        test1.start();

        // 主线程
        for (int i = 0; i < 20; i++) {
            sleep(1000);
            System.out.println("我在学多线程");
        }
    }
}
